package day05;

public class ForDemo {
    public static void main(String[] args) {
        for (int i = 0; i < 10; i++){
            System.out.println("循环第"+(i+1)+"次");
        }

        //  1-100的和
        int sum = 0;
        for (int i = 0; i <=100; i++){
            sum += i;
        }
        System.out.println("1-100的整数和是"+sum);
        sum = 0;
        for (int i = 1; i <=100; ){
            sum += i;
            i+=2;
        }
        System.out.println("1-100的奇数和是"+sum);
        sum = 0;
        for (int i = 0; i <=100; i+=2){
            sum +=i;
        }
        System.out.println("1-100的偶数和是"+sum);
    }
}
